﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Warframe_Character_Builder
{
    public enum WeaponType
    {
        Rifle = 0,
        Shotgun,
        Pistol,
        Melee
    }
    public class Weapon
    {
        private string name;
        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        private WeaponType type;
        public WeaponType Type
        {
            get { return type; }
            set { type = value; }
        }

        private int level;
        public int Level
        {
            get { return level; }
            set { level = value; }
        }

        private bool isSuperCharged;
        public bool IsSuperCharged
        {
            get { return isSuperCharged; }
            set { isSuperCharged = value; } 
        }

        private int modPoints;
        public int ModPoints
        {
            get { return modPoints; }
            set { modPoints = value; }
        }

        private int currentModPoints;
        public int CurrentModPoints
        {
            get { return currentModPoints; }
            set { currentModPoints = value; }
        }

        private List<Polarity> polarities;
        public List<Polarity> Polarities
        {
            get { return polarities; }
            set { polarities = value; }
        }

        private float damage;
        public float Damage
        {
            get { return damage; }
            set { damage = value; }
        }

        private float accuracy;
        public float Accuracy
        {
            get { return accuracy; }
            set { accuracy = value; }
        }

        private float reload;
        public float Reload
        {
            get { return reload; }
            set { reload = value; }
        }

        private float chargeSpeed;
        public float ChargeSpeed
        {
            get { return chargeSpeed; }
            set { chargeSpeed = value; }
        }

        private float chargeDamage;
        public float ChargeDamage
        {
            get { return chargeDamage; }
            set { chargeDamage = value; }
        }

        private float criticalChance;
        public float CriticalChance
        {
            get { return criticalChance; }
            set { criticalChance = value; }
        }

        private float criticalDamage;
        public float CriticalDamage
        {
            get { return criticalDamage; }
            set { criticalDamage = value; }
        }

        private float fireRate;
        public float FireRate
        {
            get { return fireRate; }
            set { fireRate = value; }
        }

        private int magazine;
        public int Magazine
        {
            get { return magazine; }
            set { magazine = value; }
        }

        private int ammoCapacity;
        public int AmmoCapacity
        {
            get { return ammoCapacity; }
            set { ammoCapacity = value; }
        }

        private List<Mod> mods;
        public List<Mod> Mods
        {
            get { return mods; }
            set { mods = value; }
        }

        public Weapon()
        {
        }

        public Weapon(string name1, int type1, int level1, bool isSuperCharged1, int modPoints1, List<Polarity> polarities1, float damage1, float accuracy1, float reload1, float chargeSpeed1, float chargeDamage1, float criticalChance1, float criticalDamage1, float fireRate1, int magazine1, int ammoCapacity1)
        {
            name = name1;
            type = (WeaponType)type1;
            level = level1;
            isSuperCharged = isSuperCharged1;
            if (isSuperCharged)
            {
                modPoints += level;
                currentModPoints = modPoints;
            }
            else
                modPoints = currentModPoints = level;
            polarities = polarities1;
            damage = damage1;
            accuracy = accuracy1;
            reload = reload1;
            chargeSpeed = chargeSpeed1;
            chargeDamage = chargeDamage1;
            criticalChance = criticalChance1;
            criticalDamage = criticalDamage1;
            fireRate = fireRate1;
            magazine = magazine1;
            ammoCapacity = ammoCapacity1;

            mods = new List<Mod>();
            Polarity tempPol = new Polarity(0);
            Mod tempMod = new Mod("default", "None", 0, 0.0f, 0.0f, 0, 0, 0, 0, tempPol);
            for (int i = 0; i < 8; ++i)
                mods.Add(tempMod);
        }
    }
}
